<!--菜单 start-->
<?php $this->load->view('defaults/common/left');?>
<!--菜单 end-->
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
        <h1><?=lang('public_ckxq')?></h1>
        <?=$this->breadcrumb->generateHTML();?>
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-search"></i><?=lang('public_ckxq')?></h3>
            </div>

            <div class="panel-body">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab-general" data-toggle="tab"><?=lang('order_ddxq')?></a></li>
                    <?php if($productList):?>
                    <li><a href="#tab-data" data-toggle="tab"><?=lang('order_cplb')?></a></li>
                    <?php endif;?>
                    <?php if($trackList):?>
                    <li><a href="#tab-links" data-toggle="tab"><?=lang('order_wxgj')?></a></li>
                    <?php endif;?>
                    <?php if($holdList):?>
                    <li><a href="#tab-option" data-toggle="tab"><?=lang('public_holdTrack')?></a></li>
                    <?php endif;?>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab-general">
                      <h3 class="panel-title" style="margin: 15px 0 10px 0;"><?=lang('order_ddzgk')?></h3>
                      <table class="table table-bordered table-hover oms-table">
                        <thead>
                          <tr>
                            <th class="text-left"><?=lang('order_wxdh')?></th>
                            <th class="text-left"><?=lang('order_lydh')?></th>
                            <th class="text-left"><?=lang('order_shipInTrack')?> | <?=lang('order_shipOutTrack')?></th>
                            <th class="text-left"><?=lang('order_wxlx')?></th>
                            <th class="text-left"><?=lang('order_fwzx')?></th>
                            <th class="text-left"><?=lang('order_hb')?></th>
                            <th class="text-right">Tax</th>
                            <th class="text-right">NIF</th>
                            <th class="text-right"><?=lang('order_lyzd')?></th>
                            <?php if($role=='admin'):?>
                            <th class="text-right">aws</th>
                            <?php endif;?>
                            <th class="text-right"><?=lang('order_zt')?></th>
                            <th class="text-right"><?=lang('order_sh')?></th>
                          </tr>
                        </thead>
                        <tbody>
                          <tr>
                            <td class="text-left"><?=$orderFirst['order_num']?></td>
                            <td class="text-left"><?=$orderFirst['source_oid']?></td>
                            <td class="text-left"><?=$orderFirst['shipinTrack']?> | <?=$orderFirst['shipoutTrack']?></td>
                            <td class="text-left"><?=$orderFirst['serviceTypeName']?></td>
                            <td class="text-left"><?=$orderFirst['serviceCenterName']?></td>
                            <td class="text-left"><?=$orderFirst['currency_code']?></td>
                            <td class="text-right"><?=$orderFirst['tax']?></td>
                            <td class="text-right"><?=$orderFirst['nif']?></td>
                            <td class="text-right"><?=$orderFirst['websiteName']?></td>
                            <?php if($role=='admin'):?>
                               <td class="text-right"><?=$orderFirst['aws']?></td>
                            <?php endif;?>
                            <td class="text-right">
                                <?=$orderFirst['statusName']?>
                                <a class=" btn btn-oms btn-xs" href="<?=blang_url('orders/Order_new/reloadStatus/'.$orderFirst['id'])?>" >reStatus</a>
                            </td>
                              <td class="text-right"><?=$orderFirst['arrivalRate']?:'0%'?></td>
                          </tr>
                          <?php if($orderFirst['remark']):?>
                             <tr>
                                <td colspan="<?php echo $role=='admin'?12:11;?>" style="padding: 10px;">
                                  <span><b><?=lang('order_ddbz')?>:</b>&nbsp;<?=$orderFirst['remark']?></span>
                                </td>
                              </tr>
                          <?php endif;?>
                        </tbody>
                      </table>
                      <h3 class="panel-title" style="margin: 0 0 10px 0;"><?=lang('order_khxx')?></h3>
                      <table class="table table-bordered table-hover oms-table">
                      <thead>
                        <tr>
                         <?php if($consumerFirst['type']==1):?>
                            <th class="text-left"><?=lang('order_mjbh')?></th>
                            <th class="text-left"><?=lang('order_mjmc')?></th>
                          <?php endif;?>
                          <th class="text-left"><?=lang('order_khbh')?></th>
                          <th class="text-left"><?=lang('order_khmc')?></th>
                          <th class="text-left"><?=lang('order_khdh')?></th>
                          <th class="text-right"><?=lang('order_khyx')?></th>
                          <th class="text-right"><?=lang('order_fhorrk')?></th>
                          <th class="text-right"><?=lang('order_cjrq')?></th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <?php if($consumerFirst['type']==1):?>
                            <td class="text-left"><?=$consumerFirst['id']?></td>
                            <td class="text-left"><?=$consumerFirst['name']?></td>
                          <?php endif;?>
                          <td class="text-left"><?=$orderFirst['consumer_num']?></td>
                          <td class="text-left"><pre><?=($orderFirst['consumer_name'])?><pre></td>
                          <td class="text-left"><?=$orderFirst['consumer_phone']?></td>
                          <td class="text-right"><?=$orderFirst['consumer_email']?></td>
                          <td class="text-right"><?=$orderFirst['storeOrShip']?></td>
                          <td class="text-right"><?=$orderFirst['create_time']?></td>
                        </tr>
                      </tbody>
                    </table>
                    <h3 class="panel-title" style="margin: 0 0 10px 0;"><?=lang('order_hyhyf')?></h3>
                    <table class="table table-bordered table-hover oms-table">
                      <thead>
                        <tr>
                          <th class="text-left"><?=lang('order_shfs')?></th>
                          <th class="text-left" style="width:20%;"><?=lang('order_shdz')?></th>
                          <?php if(isset($orderFirst['pickup_service'])):?>
                            <th class="text-left"><?=lang('order_sjfs')?></th>
                            <th class="text-left" style="width:20%;"><?=lang('order_sjdz')?></th>
                           <?php endif;?>
                          <?php if($orderFirst['rework_orderNum']):?>
                            <th class="text-left"><?=lang('order_fxdh')?></th>
                          <?php endif;?>

                          <th class="text-left"><?=lang('order_zyf')?></th>
                          <th class="text-left"><?=lang('order_bcje')?></th>
                          <th class="text-right"><?=lang('order_ddxj')?></th>
                          <th class="text-right"><?=lang('order_zkze')?></th>
                          <th class="text-right"><?=lang('order_zfze')?></th>
                          <?php if($orderFirst['is_pay']):?>
                          <th class="text-right"><?=lang('order_jyzje')?></th>
                          <th class="text-right"><?=lang('order_zfrq')?></th>
                          <?php endif;?>
                        </tr>
                      </thead>
                      <tbody>
                        <tr>
                          <td class="text-left"><?=$orderFirst['delivery_service']?></td>
                          <td class="text-left"><?=$orderFirst['delivery_country']?>  <?=$orderFirst['delivery_city']?> <?=$orderFirst['delivery_state']?> <?=$orderFirst['delivery_street_address']?> <?=$orderFirst['delivery_zipcode']?> </td>
                          <?php if(isset($orderFirst['pickup_service'])):?>
                            <td class="text-left"><?=$orderFirst['pickup_service']?></td>
                            <td class="text-left"><?=$orderFirst['pickup_address']?></td>
                           <?php endif;?>
                          <?php if($orderFirst['rework_orderNum']):?>
                            <td class="text-left"><?=$orderFirst['rework_orderNum']?></td>
                          <?php endif;?>
                          <td class="text-left"><?=$orderFirst['shippingFee']?></td>
                          <td class="text-left"><?=$orderFirst['supplementAmount']?></td>
                          <td class="text-right"><?=$orderFirst['orderSubtotal']?></td>
                          <td class="text-right"><?=$orderFirst['discountAmount']?></td>
                          <td class="text-right"><?=$orderFirst['grandTotal']?><br><a class=" btn btn-oms btn-xs" href="<?=blang_url('orders/Order_new/reloadPrice/'.$orderFirst['id'])?>" >reload</a></td>
                          <?php if($orderFirst['is_pay']):?>
                          <td class="text-right"><?=$orderFirst['amount_paid']?></td>
                          <td class="text-right"><?=$orderFirst['payment_date']?></td>
                          <?php endif;?>
                        </tr>
                      </tbody>
                    </table>
                    <h3 class="panel-title" style="margin: 0 0 10px 0;">小记详情</h3>
                    <table class="c_c_tables style20170608" cellspacing="0">
                        <tbody>
                          <tr>
                              <td class="tableSubtitle equa even"></td>
                              <td class="tableSubtitle equa even">商家</td>
                              <td class="tableSubtitle equa even">个人</td>
                              <td class="tableSubtitle equa even">品牌</td>
                          </tr>
                           <tr>
                              <td class="tableSubtitle equa alignRight odd">运费</td>
                              <td class="equa"><?=$orderFirst['shippingFeeMerchant']?></td>
                              <td class="equa"><?=$orderFirst['shippingFeeIndividualUser']?></td>
                              <td class="equa"><?=$orderFirst['shippingFeeBrand']?></td>
                          </tr>
                          <tr>
                              <td class="tableSubtitle equa alignRight even">补充</td>
                              <td class="equa"><?=$orderFirst['supplementAmountMerchant']?></td>
                              <td class="equa"><?=$orderFirst['supplementAmountIndividualUser']?></td>
                              <td class="equa"><?=$orderFirst['supplementAmountBrand']?></td>
                          </tr>
                          <tr>
                              <td class="tableSubtitle equa alignRight odd">订单</td>
                              <td class="equa"><?=$orderFirst['orderSubtotalMerchant']?></td>
                              <td class="equa"><?=$orderFirst['orderSubtotalIndividualUser']?>(<?=lang('order_grsfxj')?>:<?=$orderFirst['taxSubtotal']?>)</td>
                              <td class="equa"><?=$orderFirst['orderSubtotalBrand']?></td>
                          </tr>
                          <tr>
                              <td class="tableSubtitle equa alignRight even">折扣</td>
                              <td class="equa"><?=$orderFirst['discountAmountMerchant']?></td>
                              <td class="equa"><?=$orderFirst['discountAmountIndividualUser']?></td>
                              <td class="equa"><?=$orderFirst['discountAmountBrand']?></td>
                          </tr>
                          <tr>
                              <td class="tableSubtitle equa alignRight odd">支付</td>
                              <td class="equa"><?=$orderFirst['grandTotalMerchant']?></td>
                              <td class="equa"><?=$orderFirst['grandTotalIndividualUser']?></td>
                              <td class="equa"><?=$orderFirst['grandTotalBrand']?></td>
                          </tr>
                        </tbody>
                      </table>
                    </div>
                    <?php if($productList):?>
                    <div class="tab-pane" id="tab-data">
                      <table class="table table-bordered table-hover oms-table">
                        <thead>
                          <tr>
                            <th class="text-left">id</th>
                            <th class="text-left"><?=lang('order_cplx')?></th>
                            <th class="text-left">brand/model</th>
                            <th class="text-left">sku</th>
                            <th class="text-right">imei</th>
                            <th class="text-right"><?=lang('order_zt')?></th>
                            <th class="text-right"><?=lang('order_clr')?></th>
                            <th class="text-right"><?=lang('order_cz')?></th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php foreach ($productList as $key=>$rs):?>
                            <tr>
                              <td class="text-left"><?=$rs['id']?></td>
                              <td class="text-left"><?=$rs['category_name']?></td>
                              <td class="text-left"><?=$rs['product_brand']?>/<?=$rs['product_model']?></td>
                              <td class="text-left"><?=$rs['productSku']?></td>
                              <td class="text-right"><?=$rs['imei']?></td>
                              <td class="text-right"><?=$rs['status_name']?></td>
                              <td class="text-right"><?=$rs['add_user']?></td>
                              <td class="text-right">
                                  <a class="btn btn-primary btn-sm" href="<?=blang_url('products/Product_new/inDetails/'.$rs['id'])?>" target="_blank" >Detail</a>
                                  <?=$rs['statusAction']?>
                                  <?php if($this->users['account']=='admin'):?>
                                  <a class="btn btn-danger btn-sm" href="<?=blang_url('products/Product_new/del/'.$rs['id'].'/'.$page)?>" onclick="return confirm('<?=lang('public_isdel')?>')" title="<?=lang('public_sc')?>"><i class="fa fa-trash-o"></i></a>
                                  <?php endif;?>
                              </td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                      </table>
                      <?php if($show_pages):?>
                        <div class="page"><?=$show_pages?></div>
                      <?php endif;?>
                    </div>
                    <?php endif;?>
                    <?php if($trackList):?>
                      <h3 class="panel-title" style="margin: 15px 0 10px 0;"><?=lang('order_wxgj')?></h3>
                      <div class="tab-pane" id="tab-links">
                       <table class="table table-bordered table-hover oms-table">
                            <thead>
                            <tr>
                                <th class="text-left">id</th>
                                <th class="text-left"><?=lang('order_wxdh')?></th>
                                <th class="text-left"><?=lang('order_zt')?></th>
                                <th class="text-right"><?=lang('order_clr')?></th>
                                <th class="text-right"><?=lang('order_rq')?></th>
                                <th class="text-right"><?=lang('order_tbzt')?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php foreach ($trackList as $key=>$rs):?>
                                <tr>
                                  <td class="text-left"><?=$rs['id']?></td>
                                  <td class="text-left"><?=$rs['order_num']?></td>
                                  <td class="text-left"><?=$rs['status_name']?></td>
                                  <td class="text-right"><?=$rs['add_user']?></td>
                                  <td class="text-right"><?=$rs['add_time']?></td>
                                  <td class="text-right"><?=$rs['is_sync']?></td>
                                </tr>
                            <?php endforeach;?>
                            </tbody>
                        </table>
                    </div>  
                  <?php endif; ?>
                  <?php if($holdList):?>
                    <div class="tab-pane" id="tab-option">
                       <table class="table table-bordered table-hover oms-table">
                          <thead>
                          <tr>
                              <th class="text-left">id</th>
                              <th class="text-left"><?=lang('public_order_num')?></th>
                              <th class="text-left"><?=lang('public_productID')?></th>
                              <th class="text-left"><?=lang('public_remark')?></th>
                              <th class="text-right"><?=lang('public_nameInfo')?></th>
                              <th class="text-right"><?=lang('public_dateTime')?></th>
                              <th class="text-right"><?=lang('public_disposeType')?></th>
                          </tr>
                          </thead>
                          <tbody>
                          <?php foreach ($holdList as $key=>$rs):?>
                              <tr align="center">
                                  <td class="text-left"><?=$rs['id']?></td>
                                  <td class="text-left"><?=$rs['order_num']?></td>
                                  <td class="text-left"><?=$rs['pid']?></td>
                                  <td class="text-left"><?=$rs['remark']?></td>
                                  <td class="text-right"><?=$rs['name']?></td>
                                  <td class="text-right"><?=date('Y-m-d H:i:s',$rs['time'])?></td>
                                  <td class="text-right">
                                      <?php
                                          switch($rs['off_or_on']){
                                              case '1':
                                                  echo "<span style='color: red'>hold</span>";
                                                  break;
                                              case '2':
                                                  echo "<span style='color: #009900'>cancelHold</span>";
                                                  break;
                                              default:
                                                  echo "<span>无法识别</span>";
                                                  break;
                                          }
                                      ?>
                                  </td>
                              </tr>
                          <?php endforeach;?>
                          </tbody>
                      </table>
                    </div>   
                    <?php endif; ?>  
                </div>
              
            </div>
        </div>
    </div>

    
</div>
